<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:69:"/www/wwwroot/xunda-college/application/atxunda/view/sub/question.html";i:1700643491;s:69:"/www/wwwroot/xunda-college/application/atxunda/view/index/header.html";i:1700617178;}*/ ?>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title>后台管理系统</title>
<link rel="stylesheet" href="__PUBLIC__css/pintuer.css?v=1.0">
<link rel="stylesheet" href="__PUBLIC__admin/admin.css">
<link rel="stylesheet" href="__PUBLIC__layui/css/layui.css">
<script src="__PUBLIC__js/jquery.js"></script>
<script src="__PUBLIC__js/pintuer.js"></script>
<script src="__PUBLIC__js/cookie.js"></script>
<script src="__PUBLIC__layui/layui.js"></script>
</head>
<style type="text/css">
	.refresh{width: 20px;height: 20px;float: right;margin:10px 20px;display: block;}
</style>
</head>
<?php if(request()->controller() != 'Index'): ?><img src="__PUBLIC__images/refresh.png" class="refresh" title="刷新"><?php endif; ?>
<script type="text/javascript">
	$('.refresh').click(function(){layer.msg('刷新中……');window.location.reload();})
</script>
<script type="text/javascript">
	function openwinx(url,name,w,h) {
		if(!w) w=screen.width-4;
		if(!h) h=screen.height-95;
		window.open(url,name,"width=" + w + ",height=" + h + ",toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no");
	}
</script>
<link rel="stylesheet" type="text/css" href="__PUBLIC__admin/tankuang.css">
<script type="text/javascript" src="__PUBLIC__admin/UEditor/third-party/SyntaxHighlighter/shCore.js"></script>
<link rel="stylesheet" href="__PUBLIC__admin/UEditor/third-party/SyntaxHighlighter/shCoreDefault.css">
<body>
	<div class="panel admin-panel">
		<div class="panel-head"><strong class="icon-reorder"> 内容列表</strong></div>
		<div class="padding border-bottom">  
			<form method="post" action="" id="listform">
				<ul class="search" style="padding-left:10px;">
					<li> <a class="button border-main icon-plus-square-o" href="<?php echo url('ques_edit'); ?>"> 新增</a> </li>
					<li>搜索：</li>
					<li><select name="nav_id" class="input" style="width:200px; line-height:17px;" onchange="changesearch()">
						<option value="">请选择专业</option>
						<?php foreach($navData as $nav): ?>
						<option value="<?php echo $nav['nav_id']; ?>" <?php if($param['nav_id'] == $nav['nav_id']): ?>selected<?php endif; ?>><?php echo $nav['nav_name']; ?></option>
						<?php endforeach; ?>
					</select></li>
					<li><select name="type_id" class="input" style="width:200px; line-height:17px;"onchange="changesearch()">
						<option value="">请选择阶段</option>
						<?php foreach($typeData as $type): ?>
						<option value="<?php echo $type['type_id']; ?>" <?php if($param['type_id'] == $type['type_id']): ?>selected<?php endif; ?>><?php echo $type['type_name']; ?></option>
						<?php endforeach; ?>
					</select></li>
					<li><select name="s_id" class="input" style="width:200px; line-height:17px;" onchange="changesearch()">
						<option value="">请选择章节</option>
						<?php foreach($sData as $s): ?>
						<option value="<?php echo $s['s_id']; ?>" <?php if($param['s_id'] == $s['s_id']): ?>selected<?php endif; ?>><?php echo $s['s_name']; ?></option>
						<?php endforeach; ?>
					</select></li>
					<li><select name="course_id" class="input" style="width:200px; line-height:17px;"onchange="changesearch()">
						<option value="">请选择课程</option>
						<?php foreach($courseData as $course): ?>
						<option value="<?php echo $course['course_id']; ?>" <?php if($param['course_id'] == $course['course_id']): ?>selected<?php endif; ?>><?php echo $course['course_name']; ?></option>
						<?php endforeach; ?>
					</select></li>
					<li>
						<input type="text" placeholder="请输入搜索关键字" name="stem" class="input" style="width:250px; line-height:17px;display:inline-block" value="<?php echo $param['stem']; ?>" />
						<a href="javascript:void(0)" class="button border-main icon-search" onclick="changesearch()" > 搜索</a>
					</li>
				</ul>
			</form>
		</div>
		<table class="table table-hover text-center">
			<tr>
				<th>ID</th>
				<th style="text-align: left;width: 300px;">题干</th>
				<th style="text-align: left;">所属视频</th>
				<th style="text-align: left;">最后更新</th>
				<th style="text-align: left;">操作</th>
			</tr>
			<?php foreach($data as $v): ?>
			<tr>
				<td><input type="checkbox" name="id[]" value="<?php echo $v['id']; ?>" /><?php echo $v['id']; ?></td> 
				<td align="left" width="300"><?php echo htmlspecialchars($v['stem']); ?></td>
				<td align="left"><?php echo $v['nav_name']; ?><br/><?php echo $v['type_name']; ?><br/><?php echo $v['s_name']; ?><br/><?php echo $v['course_name']; ?></td>
				<td align="left"><?php echo returnAdminName($v['updated_admin_id']); ?><br><?php echo date("Y-m-d H:i:s",$v['updated_time']); ?></td>
				<td align="left"><div class="button-group">
					<a class="button border-main" href="<?php echo url('ques_edit',['id' => $v['id']]); ?>"><span class="icon-edit"></span> 修改</a>
					<a class="button border-red" href="<?php echo url('ques_del',['id' => $v['id']]); ?>" onclick="if(confirm('确定删除?')==false)return false;"><span class="icon-trash-o"></span> 删除</a>
				</div></td>
			</tr>
			<?php endforeach; ?>
			<tr>
				<td colspan="4"><?php echo $data->render(); ?></td>
			</tr>
		</table>
	</div>
</body></html>
<script>
//全选
$("#checkall").click(function(){ 
	$("input[name='id[]']").each(function(){
		if (this.checked) {
			this.checked = false;
		}
		else {
			this.checked = true;
		}
	});
});

function changesearch(){
$("#listform").submit();    //提交ID为myform的表单
}

//批量删除
function DelSelect(){
	var Checkbox=false;
	$("input[name='id[]']").each(function(){
		if (this.checked==true) {   
			Checkbox=true;  
		}
	});
	if (Checkbox){
		var t=confirm("您确认要删除选中的内容吗？");
		if (t==false) return false;   
		$('input[name=status]').val('del');
		$("#listform").submit();    
	}
	else{
		alert("请选择您要删除的内容!");
		return false;
	}
}

</script>